<%@LANGUAGE="VBSCRIPT" CODEPAGE="1251"%>
<!--#include file="..\Management\Automat\Connection.asp"-->
<!--#include file="..\Management\Automat\adovbs.inc"-->

<%
if request.QueryString("param")<>empty then

	Set cn=Server.CreateObject("ADODB.Connection")
	Set cm=Server.CreateObject("ADODB.Command")
	cn.open connStr&";Initial Catalog=Quizes"
	
	with cm
		.Activeconnection=cn
		.CommandType = adCmdStoredProc
		.Commandtext = "sp_get_ticket_prize"
		.Parameters.Append .CreateParameter("@ticket_num", advarchar, adParamInput, 10)
		.Parameters.Append .CreateParameter("@sum", adinteger, adParamOutput)
		.Parameters("@ticket_num")=request.QueryString("param")
		.Execute
	end with	
	
		sum=cm.Parameters("@sum")
		set cm=nothing
		
		response.Write sum
end if
%>
